#!/usr/bin/env bash

set -o nounset
set -o errexit
set -o pipefail

STARTUP_DIR="$( cd "$( dirname "$0" )" && pwd )"

source ${STARTUP_DIR}/../settings.sh

KUBECTL="kubectl --context=${KUBE_CONTEXT}"

ARGO_VERSION=v2.2.0

${KUBECTL} delete -n argo -f "https://raw.githubusercontent.com/argoproj/argo/${ARGO_VERSION}/manifests/install.yaml" --ignore-not-found=true

# for argo jobs
# remove admin privileges to the 'default' service account in the namespace 'default' that were created.
${KUBECTL} delete rolebinding default-admin --ignore-not-found=true

